﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UCS.XNA.Utils;

namespace Hopeless.Physical
{
    class ZombieSpawn
    {
        public ZombieSpawn(int maxZombies)
        {
            _maxZombies = maxZombies;
        }

        private Rectangle _space;
        private Random random = new Random();
        private int _maxZombies;

        public void Initialize(Rectangle availableSpace)
        {
            _space = availableSpace;
        }

        public void SpawnZombie(Zombie zombie)
        {
            var x = random.Next(_space.Left, _space.Right);
            var y = random.Next(_space.Top, _space.Bottom);
            var ang = random.Next(-314, 314) / 100;
            zombie.Position = new Vector2(x, y);
            zombie.FacingAngle = ang;
        }
    }
}
